<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../../print.css" type="text/css" media="print">
<meta content="Tracker,com.happytoad.libs.riatrax.Tracker,account,config,debug,display,mode,trackerCount,visualDebug,getInstance,trackEvent" name="keywords">
<title>com.happytoad.libs.riatrax.Tracker</title>
<script type="text/javascript" src="../../../../AC_OETags.js"></script>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'Tracker - API Documentation';
				var baseRef = '../../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">API Documentation</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../index-list.html')" href="../../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../../index.html?com/happytoad/libs/riatrax/Tracker.html&amp;com/happytoad/libs/riatrax/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;Tracker</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a>&nbsp;| <a href="#includeExamplesSummary">Examples</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class Tracker"); titleBar_setSubNav(false,true,false,false,false,false,true,true,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table width="100%" cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">com.happytoad.libs.riatrax</a></td><td valign="top" rowspan="6" align="right"><img src="../../../../logo.jpg"></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class Tracker</td>
</tr>
</table>
<p></p>
   The Tracker class in a custom wrapper class to allow for automatic Google Analytic tracking.
     <br/><br/>
   Copyright (c) 2009 HappyToad IT Consulting (<a href="http://www.happytoad.com" target="_blank">http://www.happytoad.com</a>)<br/>
      Created by Rich Tretola (<a href="http://blog.everythingflex.com" target="_blank">http://blog.everythingflex.com</a>)<br/>
   
  <p></p>
<p>
<a href="#includeExamplesSummary">View the examples.</a>
</p>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#account">account</a> : String<div class="summaryTableDescription">
   This String is also known as the Google UA number of your tracking code 
   and looks like UA-xxxxx-yy, where the x's and y's are replaced with 
   the numbers that correspond to your account and profile information for 
   the object you are tracking.</div>
</td><td class="summaryTableOwnerCol">Tracker</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#config">config</a> : Configuration<div class="summaryTableDescription">
         Determinates the Configuration object of the tracker.</div>
</td><td class="summaryTableOwnerCol">Tracker</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#debug">debug</a> : DebugConfiguration<div class="summaryTableDescription">
         Determinates the DebugConfiguration object of the tracker.</div>
</td><td class="summaryTableOwnerCol">Tracker</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#display">display</a> : DisplayObject<div class="summaryTableDescription">
   DisplayObject to hold a reference to the object.</div>
</td><td class="summaryTableOwnerCol">Tracker</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#mode">mode</a> : String<div class="summaryTableDescription">
   String, either bridge mode or AS3 mode.</div>
</td><td class="summaryTableOwnerCol">Tracker</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#trackerCount">trackerCount</a> : int<div class="summaryTableDescription">[read-only]
         The current total count of events tracked for user session.</div>
</td><td class="summaryTableOwnerCol">Tracker</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#visualDebug">visualDebug</a> : Boolean<div class="summaryTableDescription">
   Boolean set to true to show visual debugging within your application.</div>
</td><td class="summaryTableOwnerCol">Tracker</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getInstance()">getInstance</a>():<a href="../riatrax/Tracker.html">Tracker</a>
</div>
<div class="summaryTableDescription">[static]
       Returns an instance of Tracker.</div>
</td><td class="summaryTableOwnerCol">Tracker</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#trackEvent()">trackEvent</a>(category:String, action:String, label:String = null, value:Number = 0):Boolean</div>
<div class="summaryTableDescription">
       </div>
</td><td class="summaryTableOwnerCol">Tracker</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="account"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">account</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>account:String</code>&nbsp;&nbsp;[read-write]<p>
   This String is also known as the Google UA number of your tracking code 
   and looks like UA-xxxxx-yy, where the x's and y's are replaced with 
   the numbers that correspond to your account and profile information for 
   the object you are tracking.
   <br/><br/>
   This is a required property and can be obtained from Google.
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get account():String</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set account(value:String):void</code>
<br>
</div>
<a name="config"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">config</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>config:Configuration</code>&nbsp;&nbsp;[read-write]<p>
         Determinates the Configuration object of the tracker.
         <br/><br/>
         This property defaults to null
         </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get config():Configuration</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set config(value:Configuration):void</code>
<br>
</div>
<a name="debug"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">debug</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>debug:DebugConfiguration</code>&nbsp;&nbsp;[read-write]<p>
         Determinates the DebugConfiguration object of the tracker.
         <br/><br/>
         This property defaults to null
         </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get debug():DebugConfiguration</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set debug(value:DebugConfiguration):void</code>
<br>
</div>
<a name="display"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">display</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>display:DisplayObject</code>&nbsp;&nbsp;[read-write]<p>
   DisplayObject to hold a reference to the object. 
   <br/><br/>
   This property should be set to "this".
   <br/><br/>
   Example:<br/>
   Tracker.getInstance().display=this;
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get display():DisplayObject</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set display(value:DisplayObject):void</code>
<br>
</div>
<a name="mode"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">mode</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>mode:String</code>&nbsp;&nbsp;[read-write]<p>
   String, either bridge mode or AS3 mode. This mode determines how your tracking 
   communicates with the Analytics servers. ( Bridge | AS3 )
   <br/><br/>
   Use Bridge mode if you control both the HTML page and the Flash content. 
   This mode is best if you have already implemented Google Analytics (ga.js) 
   tracking on your website and you want to add tracking to embedded Flash content. 
   The bridge mode simplifies Flash-to-JavaScript communication by providing a unified 
   ActionScript 3 interface to the ga.js code. It provides the connection from the 
   ActionScript 3 calls to the Analytics JavaScript in order to make the tracking work.
   <br/><br/>
   Use AS3 mode if you control the Adobe Flash ActionScript 3 code, but you do not 
   control the hosting environment of your Adobe Flash application. For example, 
   if you are developing Flash content for distribution across many sites, then you 
   would use AS3 mode. AS3 mode is completely independent from the ga.js tracking code 
   and contains all the Analytics tracking functionality. There is no need for a separate 
   ga.js tracking installation with this mode. In addition, AS3 mode uses the Flash storage 
   mechanism to track session information for the visitor.
   <br/><br/>
   For certain DOM parameters such as language, the AS3 component tries to retrieve the 
   values from the browser. If the values are not present, the component either uses the 
   Flash equivalent value or defaults to no.
   <br/><br/>
   This property defaults to AS3
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get mode():String</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set mode(value:String):void</code>
<br>
</div>
<a name="trackerCount"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">trackerCount</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>trackerCount:int</code>&nbsp;&nbsp;[read-only]<p>
         The current total count of events tracked for user session.
         </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get trackerCount():int</code>
<br>
</div>
<a name="visualDebug"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">visualDebug</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>visualDebug:Boolean</code>&nbsp;&nbsp;[read-write]<p>
   Boolean set to true to show visual debugging within your application. ( true | false )
   This can be used to test that all is working properly.
   <br/><br/>
   This property defaults to false
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get visualDebug():Boolean</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set visualDebug(value:Boolean):void</code>
<br>
</div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="getInstance()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getInstance</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public static function getInstance():<a href="../riatrax/Tracker.html">Tracker</a></code><p>
       Returns an instance of Tracker.
             </p><p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../riatrax/Tracker.html">Tracker</a></code> &mdash; 
                        Tracker
      
                        
                     </td>
</tr>
</table>
</div>
<a name="trackEvent()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">trackEvent</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function trackEvent(category:String, action:String, label:String = null, value:Number = 0):Boolean</code><p>
       </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">category</span>:String</code> &mdash; String to be passed to Google as the Category property.
      
       </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">action</span>:String</code> &mdash; String to be passed to Google as the Action property.
      
       </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">label</span>:String</code> (default = <code>null</code>)<code></code> &mdash; String to be passed to Google as the Label property.
      
       </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">value</span>:Number</code> (default = <code>0</code>)<code></code> &mdash; Number to be passed to Google as the Value property
             </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Boolean</code> &mdash; Boolean success or fail returned from Google.
       <br/><br/>
       throws Error if category or action is null
      </td>
</tr>
</table>
</div>
<a name="includeExamplesSummary"></a>
<div class="detailSectionHeader">Examples</div>
<div class="exampleHeader">TrackerExample</div>
<div class="detailBody">
<div class="listing">
<pre>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute" xmlns:rx="com.happytoad.libs.riatrax.*"
    creationComplete="init()"&gt;
     
    &lt;mx:Script&gt;
        &lt;![CDATA[
            import com.happytoad.libs.riatrax.Tracker;
            private var tracker:Tracker = Tracker.getInstance();
          
            private function init():void{
                tracker.account="UA-xxxxx-yy";
                tracker.display=this;
                tracker.visualDebug = true;
            }
        ]]&gt;
    &lt;/mx:Script&gt;
    
    &lt;rx:Button label="Track Me" horizontalCenter="0" verticalCenter="0"/&gt;

&lt;/mx:Application&gt;</pre>
</div>
<script type="text/javascript" language="javascript">
<!--
				AC_FL_RunContent(
					"src", "examples/TrackerExample",
					"width", "100%",
					"height", "400px",
					"align", "middle",
					"id", "example1",
					"quality", "high",
					"bgcolor", "",
					"name", "example1",
					"flashvars","",
					"allowScriptAccess","sameDomain",
					"type", "application/x-shockwave-flash",
					"pluginspage", "http://www.macromedia.com/go/getflashplayer"
				);
			--></script>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
